// 云对象教程: https://uniapp.dcloud.net.cn/uniCloud/cloud-obj
// jsdoc语法提示教程：https://ask.dcloud.net.cn/docs/#//ask.dcloud.net.cn/article/129
const db=uniCloud.database();
module.exports = {
	_before: function () { // 通用预处理器
		this.params=this.getParams()[0];
	},
	async add(){
		return await db.collection("mall-brand").add(this.params);
	},
	async get(){
		return await db.collection("mall-brand").get();
	},
	async update(){
		let params={...this.params};
		delete params._id;
		return await db.collection("mall-brand").doc(this.params._id).update(params);
	}
	
}
